var limsTrainRecord = Gikam.getPageObject({

    getEditListColumns: function () {
        return [{
            checkbox: true
        }, {index: true}, Gikam.status.getBpmnColumn(limsTrainRecord.workflow.dbTable), {
            field: 'trainCategory',
            title: 'T_LIMS_TRAIN_RECORD.TRAINCATEGORY',
            type: 'select',
            search: true,
            category: 'sys',
            param: {
                codeCategoryId: 'trainCategory'
            },
            validators: ['notEmpty']
        }, {
            field: 'trainTopics',
            title: 'T_LIMS_TRAIN_RECORD.TRAINTOPICS',
            validators: ['notEmpty']
        }, {
            field: 'trainContent',
            title: 'T_LIMS_TRAIN_RECORD.TRAINCONTENT',
            validators: ['notEmpty']
        }, {
            field: 'trainTime',
            title: 'T_LIMS_TRAIN_RECORD.TRAINTIME',
            width: 150,
            validators: ['notEmpty']
        }, {
            field: 'trainLocation',
            title: 'T_LIMS_TRAIN_RECORD.TRAINLOCATION',
            validators: ['notEmpty']
        }, {
            field: 'trainInstructor',
            title: 'T_LIMS_TRAIN_RECORD.TRAININSTRUCTOR',
            validators: ['notEmpty']
        }, {
            field: 'trainPerson',
            title: 'T_LIMS_TRAIN_RECORD.TRAINPERSON',
            validators: ['notEmpty']
        }, {
            field: 'remark',
            title: 'T_LIMS_TRAIN_RECORD.REMARK',
            validators: ['notEmpty']
        }, {
            field: 'createdByName',
            title: 'T_LIMS_TRAIN_RECORD.CREATEDBYNAME'
        }, {
            field: 'createdTime',
            type: 'dateTime',
            title: 'T_LIMS_TRAIN_RECORD.CREATEDTIME',
            width: 150
        }]
    },

    getBaseInfoFormFields: function () {
        return [{
            field: 'trainCategory',
            title: 'T_LIMS_TRAIN_RECORD.TRAINCATEGORY',
            validators: ['strLength[0,24]', 'notEmpty'],
            preInsert: true,
            type: 'select',
            search: true,
            category: 'sys',
            param: {
                codeCategoryId: 'trainCategory'
            },
            firstBlank: false,
        }, {
            field: 'trainTopics',
            title: 'T_LIMS_TRAIN_RECORD.TRAINTOPICS',
            validators: ['strLength[0,40]', 'notEmpty'],
            preInsert: true
        }, {
            field: 'trainContent',
            title: 'T_LIMS_TRAIN_RECORD.TRAINCONTENT',
            validators: ['strLength[0,66]', 'notEmpty'],
            preInsert: true
        }, {
            field: 'trainTime',
            title: 'T_LIMS_TRAIN_RECORD.TRAINTIME',
            type: 'dateTime',
            validators: ['notEmpty'],
            preInsert: true
        }, {
            field: 'trainInstructor',
            title: 'T_LIMS_TRAIN_RECORD.TRAININSTRUCTOR',
            validators: ['strLength[0,20]', 'notEmpty'],
            preInsert: true
        }, {
            field: 'trainLocation',
            title: 'T_LIMS_TRAIN_RECORD.TRAINLOCATION',
            validators: ['strLength[0,40]', 'notEmpty'],
            preInsert: true
        }, {
            field: 'trainPerson',
            title: 'T_LIMS_TRAIN_RECORD.TRAINPERSON',
            validators: ['strLength[0,160]', 'notEmpty'],
            preInsert: true,
            type: 'choose',
            category: 'mult-user',
            onAfterChoose: function (rows, index) {
                if (rows && rows.length > 0) {
                    var trainPerson = rows.map(u => u.userName).join(',')
                    var trainPersonId = rows.map(u => u.id).join(',')
                    this.setData({
                        trainPersonId: trainPersonId,
                        trainPerson: trainPerson
                    })
                }
            },
            onClean: function () {
                this.setData({
                    trainPersonId: '',
                    trainPerson: ''
                })
            },
        }, {
            field: 'remark',
            title: 'T_LIMS_TRAIN_RECORD.REMARK',
            validators: ['strLength[0,66]', 'notEmpty'],
            type: 'textarea',
            preInsert: true
        },]
    },

    getAuditListColumns: function () {
        return [{
            checkbox: true
        }, {index: true}, Gikam.status.getBpmnColumn(limsTrainRecord.workflow.dbTable), {
            field: 'trainCategory',
            title: 'T_LIMS_TRAIN_RECORD.TRAINCATEGORY',
            type: 'select',
            search: true,
            category: 'sys',
            param: {
                codeCategoryId: 'trainCategory'
            },
        }, {
            field: 'trainTopics',
            title: 'T_LIMS_TRAIN_RECORD.TRAINTOPICS'
        }, {
            field: 'trainContent',
            title: 'T_LIMS_TRAIN_RECORD.TRAINCONTENT'
        }, {
            field: 'trainTime',
            title: 'T_LIMS_TRAIN_RECORD.TRAINTIME',
            width: 150
        }, {
            field: 'trainLocation',
            title: 'T_LIMS_TRAIN_RECORD.TRAINLOCATION'
        }, {
            field: 'trainInstructor',
            title: 'T_LIMS_TRAIN_RECORD.TRAININSTRUCTOR'
        }, {
            field: 'trainPerson',
            title: 'T_LIMS_TRAIN_RECORD.TRAINPERSON'
        }, {
            field: 'remark',
            title: 'T_LIMS_TRAIN_RECORD.REMARK'
        }, {
            field: 'createdByName',
            title: 'T_LIMS_TRAIN_RECORD.CREATEDBYNAME'
        }, {
            field: 'createdTime',
            type: 'dateTime',
            title: 'T_LIMS_TRAIN_RECORD.CREATEDTIME',
            width: 150
        }]
    },

    getSearchListColumns: function () {
        return [{
            checkbox: true
        }, {index: true}, Gikam.status.getBpmnColumn(limsTrainRecord.workflow.dbTable), {
            field: 'trainCategory',
            title: 'T_LIMS_TRAIN_RECORD.TRAINCATEGORY',
            type: 'select',
            search: true,
            category: 'sys',
            param: {
                codeCategoryId: 'trainCategory'
            },
        }, {
            field: 'trainTopics',
            title: 'T_LIMS_TRAIN_RECORD.TRAINTOPICS'
        }, {
            field: 'trainContent',
            title: 'T_LIMS_TRAIN_RECORD.TRAINCONTENT'
        }, {
            field: 'trainTime',
            title: 'T_LIMS_TRAIN_RECORD.TRAINTIME',
            width: 150
        }, {
            field: 'trainLocation',
            title: 'T_LIMS_TRAIN_RECORD.TRAINLOCATION'
        }, {
            field: 'trainInstructor',
            title: 'T_LIMS_TRAIN_RECORD.TRAININSTRUCTOR'
        }, {
            field: 'trainPerson',
            title: 'T_LIMS_TRAIN_RECORD.TRAINPERSON'
        }, {
            field: 'remark',
            title: 'T_LIMS_TRAIN_RECORD.REMARK'
        }, {
            field: 'createdByName',
            title: 'T_LIMS_TRAIN_RECORD.CREATEDBYNAME'
        }, {
            field: 'createdTime',
            type: 'dateTime',
            title: 'T_LIMS_TRAIN_RECORD.CREATEDTIME',
            width: 150
        }]
    },

    getChooseListColumns: function () {
        return [{index: true},{
            field: 'trainCategory',
            title: 'T_LIMS_TRAIN_RECORD.TRAINCATEGORY',
            type: 'select',
            search: true,
            category: 'sys',
            param: {
                codeCategoryId: 'trainCategory'
            },
        }, {
            field: 'trainTopics',
            title: 'T_LIMS_TRAIN_RECORD.TRAINTOPICS'
        }, {
            field: 'trainContent',
            title: 'T_LIMS_TRAIN_RECORD.TRAINCONTENT'
        }, {
            field: 'trainTime',
            title: 'T_LIMS_TRAIN_RECORD.TRAINTIME',
            width: 150
        }, {
            field: 'trainLocation',
            title: 'T_LIMS_TRAIN_RECORD.TRAINLOCATION'
        }, {
            field: 'trainInstructor',
            title: 'T_LIMS_TRAIN_RECORD.TRAININSTRUCTOR'
        }, {
            field: 'trainPerson',
            title: 'T_LIMS_TRAIN_RECORD.TRAINPERSON'
        }, {
            field: 'remark',
            title: 'T_LIMS_TRAIN_RECORD.REMARK'
        }, {
            field: 'createdByName',
            title: 'T_LIMS_TRAIN_RECORD.CREATEDBYNAME'
        }, {
            field: 'createdTime',
            type: 'dateTime',
            title: 'T_LIMS_TRAIN_RECORD.CREATEDTIME',
            width: 150
        }]
    },

    baseUrl: IFM_CONTEXT + '/secure/basemodule/rm/train-records',

    workflow: {
        dbTable: 'T_LIMS_TRAIN_RECORD',
        columns: [{
            field: 'id',
            title: 'T_LIMS_TRAIN_RECORD.ID'
        }]
    },

    /**
     * 审核记录
     */
    getFlowListColumns: function () {
        return [{
            index: true
        }, {
            title: 'CORE.MODULE.SYS.T_CORE_BPMN_DIAGRAM.CANDIDATOR.TASKNAME',
            field: 'taskName',
        }, {
            title: 'CORE.MODULE.SYS.T_CORE_BPMN_DIAGRAM.CANDIDATOR.USER',
            field: 'auditedByName'
        }, {
            title: 'T_CORE_INTERNAL_AUDIT.AUDITDATE',
            field: 'auditedTime',
            width: 140
        }, {
            title: 'GIKAM.WORKFLOW.PASS.OPINION.TITLE',
            field: 'comment',
            width: 300
        }, {
            title: 'CORE.MODULE.SYS.T_CORE_BPMN_DIAGRAM.COMMENT.ROUTE',
            field: 'route',
            width: 140
        }]
    },

})
